﻿using System;

namespace DNX.IoCnoC
{
    public interface IIntercepted
    {
        object Return { get; set; }
        object Instance { get;  }
        object[] Parameters { get;  }
        Action Proceed { get;  }
        string MethodName { get;  }
        string Namespace { get; }
        Type[] ParameterTypes { get; }
    }

    public class Intercepted : IIntercepted
    {
        public Intercepted(Action<Intercepted> proceed)
        {
            Proceed = () => proceed(this);
        }

        public object Return { get; set; }
        public object Instance { get; set; }
        public object[] Parameters { get; set; }
        public Action Proceed { get; private set; }
        public string MethodName { get; set; }
        public string Namespace { get; set; }
        public Type[] ParameterTypes { get; set; }
    }
}